package com.my.chapter10;

public class practice10 {
    public static void main(String[] args) {
        Outer10 o = new Outer10();
        B b = o.getInner();
        b.display();
    }
}

interface B{
    void display();
}

class Outer10{
    B getInner(){
        if(true){
            class Inner implements B{

                @Override
                public void display() {
                    System.out.println("Inner.display()");
                }
            }
            Inner i = new Inner();
            return i;
        }else{
            return null;
        }
    }
}
